package lesson04.a;

public class Student {
    private String name;
    private int age;
    private String gender;
    private String phone;
    public static final String MY_INFO = "学生信息";

    public Student(){}
    public String getName(){
        return this.name;
    }
    public void setName(String name){
        this.name = name;
    }
    public int getAge(){
        return this.age;
    }
    public void setAge(int age){
        if(age >= 18 && age <= 30){
            this.age = age;
        }
        System.out.println("年龄超过指定范围");

    }
    public void intro(){
        System.out.println(Student.MY_INFO);
    }
    public static void say(){
        System.out.println("静态方法");
    }

    public static void main(String[] args) {
        Student student = new Student();
        student.setName("张三");
        student.setAge(-50);
        System.out.println(student.getName());
        System.out.println(student.getAge());

        System.out.println(MY_INFO);
        Student.say();
    }
}
